﻿<Window x:Class="HighLandirect.Presentation.Views.ShellWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:p="clr-namespace:HighLandirect.Presentation.Properties"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="clr-namespace:HighLandirect.Applications.ViewModels;assembly=HighLandirect.Applications"
    mc:Ignorable="d" d:DataContext="{d:DesignInstance vm:ShellViewModel}"
    Title="{Binding Title}" Icon="{StaticResource BookLibraryImageSource}"
    Height="600" Width="1000">
    
    <Window.InputBindings>
        <KeyBinding x:Name="saveKeyBinding" Key="S" Modifiers="Control"/>
    </Window.InputBindings>
    
    <DockPanel>
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="{x:Static p:Resources.DataMenu}">
                <MenuItem Command="{Binding SaveCommand}" Header="{x:Static p:Resources.SaveMenu}" Icon="{StaticResource SaveImage}" 
                          InputGestureText="{x:Static p:Resources.ControlS}"/>
                <Separator/>
                <MenuItem Command="{Binding GetBackUpDataCommand}" Header="バックアップ用データ取得" Icon="{StaticResource DownLoadImage}" />
                <MenuItem Command="{Binding SetBackUpDataCommand}" Header="バックアップ用データ復元" Icon="{StaticResource UpLoadImage}" />
                <Separator/>
                <MenuItem Command="{Binding GetExportDataCommand}" Header="データエクスポート" Icon="{StaticResource DownLoadImage}" />
                <MenuItem Command="{Binding SetImportDataCommand}" Header="データインポート" Icon="{StaticResource UpLoadImage}" />
                <Separator/>
                <MenuItem Command="{Binding ExitCommand}" Header="{x:Static p:Resources.ExitMenu}"/>
            </MenuItem>
            <MenuItem Header="{x:Static p:Resources.EditMenu}">
                <MenuItem Command="ApplicationCommands.Undo" Header="{x:Static p:Resources.UndoMenu}" Icon="{StaticResource UndoImage}"/>
                <MenuItem Command="ApplicationCommands.Redo" Header="{x:Static p:Resources.RedoMenu}" Icon="{StaticResource RedoImage}"/>
                <Separator/>
                <MenuItem Command="ApplicationCommands.Cut" Header="{x:Static p:Resources.CutMenu}" Icon="{StaticResource CutImage}"/>
                <MenuItem Command="ApplicationCommands.Copy" Header="{x:Static p:Resources.CopyMenu}" Icon="{StaticResource CopyImage}"/>
                <MenuItem Command="ApplicationCommands.Paste" Header="{x:Static p:Resources.PasteMenu}" Icon="{StaticResource PasteImage}"/>
                <MenuItem Command="EditingCommands.Delete" Header="{x:Static p:Resources.DeleteMenu}" Icon="{StaticResource DeleteImage}"/>
                <Separator/>
                <MenuItem Command="ApplicationCommands.SelectAll" Header="{x:Static p:Resources.SelectAllMenu}"/>
            </MenuItem>
            <MenuItem Header="{x:Static p:Resources.HelpMenu}">
                <MenuItem Command="{Binding AboutCommand}" Header="{x:Static p:Resources.AboutMenu}"/>
            </MenuItem>
        </Menu>

        <ToolBarTray DockPanel.Dock="Top">
            <ToolBar>
                <Button Command="{Binding SaveCommand}" Content="{StaticResource SaveImage}" ToolTip="{x:Static p:Resources.Save}"/>
                <Separator/>
                <Button Command="ApplicationCommands.Undo" Content="{StaticResource UndoImage}" ToolTip="{x:Static p:Resources.Undo}"/>
                <Button Command="ApplicationCommands.Redo" Content="{StaticResource RedoImage}" ToolTip="{x:Static p:Resources.Redo}"/>
                <Button Command="ApplicationCommands.Cut" Content="{StaticResource CutImage}" ToolTip="{x:Static p:Resources.Cut}"/>
                <Button Command="ApplicationCommands.Copy" Content="{StaticResource CopyImage}" ToolTip="{x:Static p:Resources.Copy}"/>
                <Button Command="ApplicationCommands.Paste" Content="{StaticResource PasteImage}" ToolTip="{x:Static p:Resources.Paste}"/>
            </ToolBar>
        </ToolBarTray>

        <StatusBar DockPanel.Dock="Bottom">
            <StatusBarItem Content="{x:Static p:Resources.Ready}"/>
        </StatusBar>

        <TabControl>
            <TabItem Header="{x:Static p:Resources.Order}">
                
                <ContentControl Content="{Binding OrderListView}" Grid.Row="0" Grid.Column="0" />

            </TabItem>
            <TabItem Header="{x:Static p:Resources.AddressBook}">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="500" 
                                          MinWidth="{Binding Content.MinWidth, ElementName=customerViewPresenter}"/>
                    </Grid.ColumnDefinitions>

                    <ContentControl Content="{Binding CustomerListView}" Grid.Row="0" Grid.Column="0" Margin="0,0,7,0"/>

                    <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="0" Grid.Column="1">
                        <ContentControl x:Name="customerViewPresenter" Content="{Binding CustomerView}"/>
                    </ScrollViewer>

                    <GridSplitter HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="4" Grid.Row="0" Grid.Column="0"/>
                </Grid>
            </TabItem>
            <TabItem Header="{x:Static p:Resources.Product}">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="500"
                                          MinWidth="{Binding Content.MinWidth, ElementName=productViewPresenter}"/>
                    </Grid.ColumnDefinitions>

                    <ContentControl Content="{Binding ProductListView}" Grid.Row="0" Grid.Column="0" Margin="0,0,7,0"/>

                    <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="0" Grid.Column="1">
                        <ContentControl x:Name="productViewPresenter" Content="{Binding ProductView}"/>
                    </ScrollViewer>

                    <GridSplitter HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="4" Grid.Row="0" Grid.Column="0"/>
                </Grid>
            </TabItem>
        </TabControl>

    </DockPanel>
    
</Window>
